package com.huarui.purchaseOrder.service.provider.remark;

import com.huarui.purchaseOrder.model.PurOrSaleOrder;
import com.huarui.task.model.Task;
import com.huarui.task.taskEnum.WorkFlowTaskNameEnum;

public class PurOrSaleRemarkUtil {
	
	public static String getRemark(PurOrSaleOrder orders) {
		if(orders.getCreatorCompanyId().equals(orders.getBuyerId())) {
			if(WorkFlowTaskNameEnum.WORKFLOWID_TASKNAME_NOT_ONLINE_PURCHASE_ORDER.getWorkFlowId().equals(orders.getWorkFlowId())) {
				return orders.getBuyerName() + "向" + orders.getPartnerNameByBuyer() + "下了一张" + 
				WorkFlowTaskNameEnum.WORKFLOWID_TASKNAME_NOT_ONLINE_PURCHASE_ORDER.getTaskName() + 
				",金额为 " + orders.getAmount().doubleValue();
			} else {
				return orders.getBuyerName() + "向" + orders.getPartnerNameByBuyer() + "下了一张" + 
				WorkFlowTaskNameEnum.WORKFLOWID_TASKNAME_ONLINE_PURCHASE_ORDER.getTaskName() + 
				",金额为 " + orders.getAmount().doubleValue();
			}
		} else {
			if(WorkFlowTaskNameEnum.WORKFLOWID_TASKNAME_NOT_ONLINE_SALE_ORDER.getWorkFlowId().equals(orders.getWorkFlowId())) {
				return orders.getSellerName() + "向" + orders.getPartnerNameBySeller() + "下了一张" + 
				WorkFlowTaskNameEnum.WORKFLOWID_TASKNAME_NOT_ONLINE_SALE_ORDER.getTaskName() + 
				",金额为 " + orders.getAmount().doubleValue();
			} else {
				return orders.getSellerName() + "向" + orders.getPartnerNameBySeller() + 
				"下了一张" + WorkFlowTaskNameEnum.WORKFLOWID_TASKNAME_ONLINE_SALE_ORDER.getTaskName() + ",金额为 " + 
				orders.getAmount().doubleValue();
			}
		}
	}
	
}
